﻿#pragma  once


#include "df_macro.h"
#include "BaseChar.h"

namespace df{

	namespace sdf{


		template<typename _CharT>
		std::basic_string<_CharT> & operator +=(std::basic_string<_CharT> & str,const void * num)
		{
			df::DigitProc<const void *, _CharT> i;
			auto len = i.Set(num);
			return str.append(i.char_, len);
		}


		template<typename _CharT>
		std::basic_string<_CharT> & operator +=(std::basic_string<_CharT> & str, int16_t num)
		{
			df::DigitProc<int16_t, _CharT> i;
			auto len = i.Set(num);
			return str.append(i.char_, len);
		}

		template<typename _CharT>
		std::basic_string<_CharT> & operator +=(std::basic_string<_CharT> & str, int32_t num)
		{
			df::DigitProc<int32_t, _CharT> i;
			auto len = i.Set(num);
			return str.append(i.char_, len);
		}

//#if WIN32
		template<typename _CharT>
		std::basic_string<_CharT> & operator +=(std::basic_string<_CharT> & str, long num)
		{
			df::DigitProc<long, _CharT> i;
			auto len = i.Set(num);
			return str.append(i.char_, len);
		}
//#endif

		template<typename _CharT>
		std::basic_string<_CharT> & operator +=(std::basic_string<_CharT> & str, int64_t num)
		{
			df::DigitProc<int64_t, _CharT> i;
			auto len = i.Set(num);
			return str.append(i.char_, len);
		}

		template<typename _CharT>
		std::basic_string<_CharT> & operator +=(std::basic_string<_CharT> & str, uint16_t num)
		{
			df::DigitProc<uint16_t, _CharT> i;
			auto len = i.Set(num);
			return str.append(i.char_, len);
		}



		template<typename _CharT>
		std::basic_string<_CharT> & operator +=(std::basic_string<_CharT> & str, uint32_t num)
		{
			df::DigitProc<uint32_t, _CharT> i;
			auto len = i.Set(num);
			return str.append(i.char_, len);
		}

//#if WIN32
		template<typename _CharT>
		std::basic_string<_CharT> & operator +=(std::basic_string<_CharT> & str, unsigned long num)
		{
			df::DigitProc<unsigned long, _CharT> i;
			auto len = i.Set(num);
			return str.append(i.char_, len);
		}
//#endif

		template<typename _CharT>
		std::basic_string<_CharT> & operator +=(std::basic_string<_CharT> & str, uint64_t num)
		{
			df::DigitProc<uint64_t, _CharT> i;
			auto len = i.Set(num);
			return str.append(i.char_, len);
		}

		template<typename _CharT>
		std::basic_string<_CharT> & operator +=(std::basic_string<_CharT> & str, double num)
		{
			df::DigitProc<double, _CharT> i;
			auto len = i.Set(num);
			return str.append(i.char_, len);
		}


		template<typename _CharT, typename ValT>
		inline std::basic_string<_CharT> & operator <<(std::basic_string<_CharT> & str, const ValT & val)
		{
			return str += val;
		}

		template<typename _CharT, typename ValT>
		std::basic_string<_CharT> && operator <<(std::basic_string<_CharT> && str, const ValT & val)
		{
			return std::move(str += val);
		}


	}
}